﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotNetX.UI.Web
{
    /// <summary>
    /// This enables a control to be translatable
    /// </summary>
    public interface ITranslatableControl
    {
        /// <summary>
        /// The current language of this control
        /// </summary>
        Language CurrentLanguage
        {
            get;
        }

        /// <summary>
        /// The key of the text to translate
        /// </summary>
        string TranslationKey
        {
            get;
            set;
        }

        /// <summary>
        /// Shall this control be translated
        /// </summary>
        bool ShallTranslate
        {
            get;
            set;
        }

        /// <summary>
        /// This translates this control into the passed target language
        /// </summary>
        /// <param name="targetLanguage">The language to translate into</param>
        /// <returns>True if the translation was successfull. else false</returns>
        bool Translate(Language targetLanguage);
    }
}
